From 6bc4b6c3362af80ce7b9892c6f7cb99599e07909 Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Mon, 25 Jul 2011 16:41:33 +0100 Subject: [PATCH] VT-d: always clean up dpci timers. Message-ID: <20110718163848.GD18276@whitby.uk.xensource.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) If a VM has all its PCI devices deassigned, need_iommu(d) becomes false but it might still have DPCI EOI timers that were init_timer()d but not yet kill_timer()d. That causes xen to crash later because the linked list of inactive timers gets corrupted, e.g.: (XEN) Xen call trace: (XEN) [] set_timer+0x1c2/0x24f (XEN) [] schedule+0x129/0x5dd (XEN) [] __do_softirq+0x7e/0x89 (XEN) [] do_softirq+0x26/0x28 (XEN) [] idle_loop+0x5a/0x5c (XEN) (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) Assertion 'entry->next->prev == entry' failed at /local/scratch/tdeegan/xen-unstable.hg/xen/include:172 (XEN) **************************************** The following patch makes sure that the domain destruction path always clears up the DPCI state even if !needs_iommu(d). Signed-off-by: Tim Deegan --- xen/drivers/passthrough/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 7f70219273..d001eab5e6 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -237,7 +237,7 @@ static void pci_clean_dpci_irqs(struct domain *d) if ( !iommu_enabled ) return; - if ( !is_hvm_domain(d) || !need_iommu(d) ) + if ( !is_hvm_domain(d) ) return; spin_lock(&d->event_lock); -- 2.30.2